package com.jelly.designpattern.decorator;

/**
 * 标记B，装饰者
 * 
 * @author Jelly
 * 
 */
public class NewGoodsTag extends TagDecorator {

	TagComponent tagComponent;

	public NewGoodsTag(TagComponent tagComponent) {
		this.tagComponent = tagComponent;
		tagName = "new-goods-tag";
	}

	@Override
	public void addTag() {
		tagComponent.addTag();
		// 需要添加的操作（装饰）
		addNewGoodsTag();
	}

	private void addNewGoodsTag() {
		System.out.println("add " + tagName);
	}
}